<?
$this->load->helper('form');
?>

<h2 class = "art-postheader">Просмотр игроков.</h2>

<div class = "art-postcontent">
    <div class = "art-content-layout overview-table">
        <div class = "art-content-layout-row">
            <div class = "art-layout-cell">
                <div class = "overview-table-inner">
                    <h4>Режимы</h4>

                    <form method = "post" action = "<?= site_url() ?>players/show_players.html">
                        <label>Выбрать режим сортировки:</label>

                        <select name = "sort_mode">
                            <option value = "single"<? if (!$sort_mode) echo 'selected="selected"';?>>Одиночная</option>

                            <option value = "multi"
                                    <? if ($sort_mode) echo 'selected="selected"';?>>Мультисортировка</option>
                        </select>

                        <span class = "art-button-wrapper"> <span class = "art-button-l"> </span>
                        <span class = "art-button-r"> </span>
                        <input type = "submit" value = "Изменить!" name = "submit_sort_mode"
                               class = "art-button"> </span>
                        <br />
                        <label>Выбрать HT сервер:</label>
                        <select name = "ht_server">
                            <?
                            for ($i=70; $i < 100; $i++)
                                {
                                echo '<option value="' . $i . '"';

                                if ($ht_server == $i)
                                    echo ' selected="selected" ';

                                echo '>www' . $i . '</option>';
                                }
                            ?>
                        </select>

                        <span class = "art-button-wrapper"> <span class = "art-button-l"> </span>
                        <span class = "art-button-r"> </span>
                        <input type = "submit" value = "Изменить!" name = "submit_ht_server"
                               class = "art-button"> </span>
                    </form>
                    <?
                    if ($this->auth->hasAccess('players/show_players'))
                        {
                        echo form_open(str_replace("show_players", "export_info", $this->uri->uri_string()));
                        ?>
                        Сделать экспорт таблицы: 
                        <span class = "art-button-wrapper"> <span class = "art-button-l"> </span>
                        <span class = "art-button-r"> </span>
                        <?echo form_submit('get_export', 'Экспорт', 'class="art-button"');?>
                        </span>
                        <?echo form_close();
                        }
                    ?>
                </div>
            </div> <!-- end cell -->

            <div class = "art-layout-cell">
                <div class = "overview-table-inner">
                    <h4>Помощь</h4>
                    <?
                        if (is_array($sort_directions))
                        {
                        echo "Направления сортировки: <br />";
                        $i=1;

                        foreach ($sort_directions as $key => $sort)
                            {
                            echo "<strong>" . $i . ".</strong>";
                            echo $key . "[$sort] ";
                            $i++;
                            }
                        }
                    ?>

                    <p>Что непонятного-то. Ё-моё.</p>
                </div>
            </div> <!-- end cell -->

            <div class = "art-layout-cell">
                <div class = "overview-table-inner">
                    <h4>Сортировка</h4>

                    <?

                    echo form_open('players/show_players');
                    echo form_label('Возраст ');
                    echo form_label(' от: ');
                    echo form_input(array
                        (
                        'name'  => 'search_params[age][from]',
                        'value' => $form_values['age']['from'],
                        'size'  => '4'
                        ));

                    echo form_label('до: ');
                    echo form_input(array
                        (
                        'name'  => 'search_params[age][to]',
                        'value' => $form_values['age']['to'],
                        'size'  => '4'
                        ));

                    echo "<br />";

                    if ($this->auth->hasAccess('players/show_players', 'view_all'))
                        {
                        $skill_select=array
                            (
                            ''    => '---',
                            'kp'  => 'Keeper',
                            'df'  => 'Defender',
                            'pm'  => 'Playmaker',
                            'wg'  => 'Winger',
                            'ps'  => 'Passing',
                            'sc'  => 'Scorer',
                            'st'  => 'SetPiecer',
                            'lid' => 'Leadership',
                            );

                        for ($i=0; $i < 20; $i++)
                            {
                            $skill_select_values[$i]=$i;
                            }

                        for ($i=0; $i < 4; $i++)
                            {
                            echo form_dropdown('search_params[skill][' . $i . ']', $skill_select,
                                               $form_values['skill'][$i]);
                            echo form_label(' от: ');
                            echo form_dropdown('search_params[skill_values][' . $i . '][from]', $skill_select_values,
                                               $form_values['skill_values'][$i]['from']);
                            //echo form_input('search_params[skill_values]['.$i.'][from]', $form_values['skill_values'][$i]['from']);
                            echo form_label('  до: ');
                            echo form_dropdown('search_params[skill_values][' . $i . '][to]', $skill_select_values,
                                               $form_values['skill_values'][$i]['to']);
                            //echo form_input('search_params[skill_values]['.$i.'][to]', $form_values['skill_values'][$i]['to']);
                            echo "<br />";
                            }
                        }

                    echo form_label('Только актуальные') . ' ' . form_checkbox('search_params[only_actual]', 'Actual',
                                                                               $form_values['only_actual']) . '<br />';
                    echo form_submit('send_search', 'Поиск!');
                    echo form_submit('reset_search', 'Очистить поиск!');

                    echo form_close();
                    ?>
                </div>
            </div> <!-- end cell -->
        </div>     <!-- end row -->
    </div>         <!-- end table -->

    <div style = "display:block; float:left;">
        <?= $pagination ?> <?php echo $content; ?>
    </div>
</div>

<div class = "cleared">
</div>